home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / zport.h < prev    next >
C/C++ Source or Header  |  1991-07-05  |  24KB  |  585 lines

  1. /*****************************************************************************
  2.     ZPort.h
  3.  
  4.     This file contains portability identifiers.  It is the only file
  5. that should need modification when porting the code.  It is assumed that the
  6. compiler supports the #elif and "defined()" preprocessor directives,  but
  7. it need not be fully ANSI C compatible in all ways.
  8. *****************************************************************************/
  9.  
  10. /****************************************************************************
  11.     These identifiers enhance code readability as well as providing the
  12. capability to avoid machine-dependent data type problems.  The following
  13. types work for the VAX/VMS and SAGE/CPM-68K compilers.  If a compiler does
  14. not have 8-bit chars, 16 or 32-bit shorts and 32-bit longs,  then problems
  15. will arise.
  16.     There are many places in TECOC where one pointer is subtracted from
  17. another.  If the result is stored in a variable or sent to a function,  I
  18. have tried to define the type of the destination as ptrdiff_t.
  19.     The mode control flags (like ES, ED) are 16-bit entities defined as
  20. WORD.  The DoEvEs function will not function correctly if WORD does not
  21. produce signed 16-bit variables.
  22.     The MakDBf function will not work properly if LONG does not
  23. produce 32-bit variables.
  24. *****************************************************************************/
  25.  
  26. typedef    int        BOOLEAN;    /* holds FALSE or TRUE */
  27. typedef int        DEFAULT;    /* signed, at least 16 bits */
  28. typedef    short        WORD;        /* 16 bits signed */
  29. typedef long        LONG;        /* 32 bits signed */
  30. typedef unsigned long    ULONG;        /* 32 bits unsigned */
  31.  
  32. #define FOREVER        for(;;)        /* Infinite loop declaration */
  33.  
  34. /*
  35.  * Define TRUE and FALSE if they haven't been defined already.
  36.  */
  37.  
  38. #ifndef FALSE
  39. #define FALSE 0
  40. #endif
  41. #ifndef TRUE
  42. #define TRUE 1
  43. #endif
  44.  
  45. /*****************************************************************************
  46.     The following identifiers determine which compiler is being used.
  47. Only ONE of the following identifiers should be defined.
  48.     The UNKNOWN identifier should only be used when porting TECO-C to a
  49. new environment.  When set,  it will cause stubs to be compiled for all the
  50. system-dependent functions.
  51. *****************************************************************************/
  52.  
  53. /*#define __GNUC__    automatically defined by FSF GNU C        */
  54. /*#define __POWERC    automatically defined by Mix Power C        */
  55. /*#define unix        automatically defined by unix C            */
  56. /*#define __TURBOC__    automatically defined by Borland Turbo C    */
  57. /*#define UNKNOWN    unknown compiler                */
  58. /*#define VAX11C    automatically defined by DEC VAX-11 C        */
  59. /*#define AMIGA        automatically defined by SAS Institute C    */
  60.  
  61. /*****************************************************************************
  62.     There are three things which can be enabled during debugging:
  63.  
  64.     CHECKSUM_CODE (under Turbo C only) will verify at run-time that
  65. code isn't being corrupted by stray pointers.
  66.  
  67.     CONSISTENCY_CHECKING will check various pointers after each command
  68. is executed and verify that they are "consistent"; for example, that edit
  69. buffer pointers point into the edit buffer and not elsewhere.
  70.  
  71.     DEBUGGING enables code included at the entry and exit of every
  72. function so a "function trace" can be displayed.  The unused TECO command
  73. ^P sets the level of detail which is displayed by the debugging routines
  74. in TECOC.C.
  75. *****************************************************************************/
  76.  
  77. #ifndef CHECKSUM_CODE            /* if not defined on command line */
  78. #define CHECKSUM_CODE (FALSE && defined(__TURBOC__))
  79. #endif
  80. #ifndef CONSISTENCY_CHECKING        /* if not defined on command line */
  81. #define CONSISTENCY_CHECKING FALSE    /* check pointer consistency */
  82. #endif
  83. #ifndef DEBUGGING            /* if not defined on command line */
  84. #define DEBUGGING FALSE            /* compile debugging code */
  85. #endif
  86.  
  87. /*****************************************************************************
  88.     Determine what memory model we're running under Turbo C and set
  89. whether we have small (near, 64K) or large (far, 1MB) code and data 
  90. references.
  91. *****************************************************************************/
  92.  
  93. #if defined(__TURBOC__)
  94.  
  95. #define TC_SMALL_DATA (defined(__SMALL__) || defined(__MEDIUM__))
  96. #define TC_SMALL_CODE (defined(__SMALL__) || defined(__COMPACT__))
  97.  
  98. #if DEBUGGING && TC_SMALL_CODE
  99. /* GNU C objects to this #error directive even though it should skip it? */
  100. /* redefining main() should stop the compiler */
  101. /* #error DEBUGGING=TRUE needs large code model */
  102. main() {}
  103. #endif
  104.  
  105. #else
  106.  
  107. #define TC_SMALL_DATA FALSE
  108. #define TC_SMALL_CODE FALSE
  109.  
  110. #endif
  111.  
  112. /*****************************************************************************
  113.     The debugging code uses the standard library so we need to get
  114. prototypes for the standard functions.  When not debugging, the only TECO-C
  115. functions which need the standard library are in the Z*.C system-specific
  116. code files which explicitly #include these header files.
  117. *****************************************************************************/
  118.  
  119. #if (CHECKSUM_CODE || CONSISTENCY_CHECKING || DEBUGGING)
  120. #if defined(unix)
  121. extern int printf();
  122. /*extern int sprintf();*/
  123. extern int puts();
  124. #else
  125. #include <stdio.h>
  126. #include <stdlib.h>
  127. #include <string.h>
  128. #endif
  129. #endif
  130.  
  131. /*****************************************************************************
  132.     Define VIDEO,  which compiles in some kind of video code,  even if
  133. it's just stubs.  Define CURSES to get video support.  Note that the CURSES
  134. is checked in some files before this file is included,  so it HAS to be
  135. defined on the command line.
  136. *****************************************************************************/
  137.  
  138. #ifdef CURSES            /* if CURSES is defined on command line */
  139. #define VIDEO TRUE
  140. #else
  141. #define CURSES FALSE
  142. #ifndef VIDEO            /* if VIDEO is not defined on command line */
  143. #define VIDEO FALSE
  144. #endif
  145. #endif
  146.  
  147. /****************************************************************************
  148.     The brain-damaged memory addressing of the IBM PC requires that all
  149. character pointers used in TECO-C be "huge" pointers.  "Huge" pointers are
  150. like "far" pointers in that they are 32-bits (a 16-bit SEGMENT and a 16-bit
  151. OFFSET); however, when you do far pointer arithmetic, only the OFFSET is
  152. affected so adding to a far pointer eventually causes the OFFSET to wrap
  153. around to zero.  When you do huge pointer arithmetic, both the OFFSET and
  154. the SEGMENT are properly updated.  Huge pointers are also normalized so
  155. pointer comparisons work correctly.  For these reasons, all pointers
  156. are declared using the following typedefs,  which are special on PCs.
  157. ****************************************************************************/
  158.  
  159. #if (defined(__TURBOC__) && !TC_SMALL_DATA) || defined(__POWERC)
  160. #define _Huge huge
  161. #else
  162. #define _Huge /**/
  163. #endif
  164.  
  165. typedef unsigned char _Huge *    charptr;
  166. #if defined(unix)
  167. typedef unsigned char *        voidptr;
  168. #else
  169. typedef void _Huge *        voidptr;
  170. #endif
  171. typedef struct EStck _Huge *    ESptr;
  172. typedef struct MStck _Huge *    MSptr;
  173. typedef struct QReg  _Huge *    QRptr;
  174.  
  175. #undef _Huge
  176.  
  177. /****************************************************************************
  178.     Some compilers allow function prototypes to be defined for functions
  179. even when the function declarations aren't written in prototype form.  This
  180. allows checking of function calls for correctness,  but doesn't guarantee
  181. that prototypes and declarations match.  I choose to leave the actual
  182. function declarations in non-prototype form,  so they work with older
  183. compilers.  Defining USE_PROTOTYPES to TRUE causes prototypes to be defined
  184. in TECOC.H for all functions.  Defining it FALSE causes old-style definitions
  185. in TECOC.H.
  186.     GNU C is one of the compilers that forces consistency:  if you use
  187. prototypes,  then declarations have to match the prototypes.  The only way
  188. I can do this in TECOC code is to surround each function declarations with
  189. "#if USE_PROTOTYPES...#else...#endif" directives.  This looks hideous, so I
  190. just don't use prototypes in GNU C.
  191. ****************************************************************************/
  192.  
  193. #if defined(VAX11C) || defined(__TURBOC__) || defined(__POWERC) || defined(ULTRIX)
  194. #define USE_PROTOTYPES TRUE
  195. #else
  196. #define USE_PROTOTYPES FALSE
  197. #endif
  198.  
  199. /****************************************************************************
  200.     ANSI C compilers are supposed to concatenate adjacent string literals
  201. in source code.  If they do,  a superior form of the command-line parsing
  202. macro (in CLPARS.H, used by ZPrsCL), is used.  If not,  a klunkier form needs
  203. to be used.
  204.     Note:  The clpars[] string is over 3 Kbytes long, so in addition to
  205. supporting string concatenation, the compiler must support long strings.  The
  206. Power C v1.3.0 compiler, for example, supports ANSI string concatenation, but
  207. does not like the 3 Kbyte clpars[] string.
  208. ****************************************************************************/
  209.  
  210. #if defined(__TURBOC__) || defined(__GNUC__)
  211. #define USE_ANSI_CLPARS TRUE
  212. #else
  213. #define USE_ANSI_CLPARS FALSE
  214. #endif
  215.  
  216. /*****************************************************************************
  217.     Define ptrdiff_t (the type of things that can hold the result when
  218. one pointer is subtracted from another), size_t (the size of memory objects
  219. and repeat counts), and NULL.
  220. *****************************************************************************/
  221.  
  222. #if defined(unix) || defined(UNKNOWN) || defined(AMIGA) && !defined(ULTRIX)
  223.  
  224. #if sun
  225. #ifdef SUNOS4_0
  226. typedef int    ptrdiff_t;    /* not in /sys/types.h yet */
  227. #endif
  228. #include <sys/types.h>        /* size_t (and maybe ptrdiff_t) */
  229. #else /* sun */
  230. typedef int    ptrdiff_t;
  231. typedef ULONG    size_t;
  232. #endif /* sun */
  233.  
  234. #ifdef AMIGA
  235. #define NULL 0L
  236. #else
  237. #define NULL 0
  238. #endif
  239.  
  240. #else
  241. #include <stddef.h>        /* define ptrdiff_t, size_t and NULL */
  242. #endif
  243.  
  244. /*****************************************************************************
  245.     Define SIZE_T,  which on most machines will be the same as size_t.
  246. There are problems (as usual) on the IBM PC.  In various places,  TECO-C
  247. subtracts two pointers and puts the resulting value in a variable of type
  248. SIZE_T.  Under Turbo C,  size_t is 16 bits,  which won't work,  so we
  249. use unsigned long for SIZE_T for TURBO C.
  250. *****************************************************************************/
  251.  
  252. #if (defined(__TURBOC__) && !TC_SMALL_DATA) || defined(__POWERC)
  253. typedef ULONG SIZE_T;        /* PCs suck */
  254. #elif defined(unix)
  255. typedef unsigned int SIZE_T;    /* override their size_t, which is "int" */
  256. #else
  257. typedef size_t SIZE_T;        /* use size_t as defined above */
  258. #endif
  259.  
  260. /*****************************************************************************
  261.     The values of the following identifiers are system-dependent.
  262.  
  263. EXTERN    usually "extern",  this identifier lets the more useful keyword
  264.     "globalref" be used to define an external variable in VAX C.
  265. GLOBAL    used for the single definition of a variable.  This identifier
  266.     allows the use of the keyword "globaldef" in VAX C.
  267. EXTERNV used only for GotCtC, this means "extern volatile" for compilers that
  268.     support the "volatile" keyword.
  269. GLOBALV used only for GotCtC, this means "volatile" for compilers that
  270.     support the "volatile" keyword.
  271. VVOID    if the compiler supports the keyword "void",  then this should be
  272.     defined as such,  else it should be meaningless.  It would be nice
  273.     to use "VOID" instead of "VVOID",  but the damn curses.h file defines
  274.     "VOID".
  275.  
  276. EBFEXP    amount by which the edit buffer is expanded each time the user tries
  277.     to insert too much text.
  278. EBFINIT    initial size of the edit buffer.  This value is added to IBFINIT
  279.     to create a value used to initially allocate both buffers.
  280. ERBFSIZ Size of error message buffer.  A missing tag message for a bad Otag$
  281.     command might be long...
  282. GAPMIN    minimum size of the edit buffer gap.  This value should be set such
  283.     that there's enough room to hold the text of the largest expected
  284.     insertion command.
  285. IBFEXP    amount by which the input buffer is expanded each time it becomes
  286.     too small for a reasonable-length line (IBFMIN) to be read.
  287. IBFINIT    initial size of the input buffer.  This value is added to EBFINIT
  288.     to create a value used to initially allocate both buffers.
  289. IBFMIN    minimum size of the input buffer.  This value is checked before each
  290.     read operation.
  291. NIFDBS    number of input file data blocks.  This should be 3 plus the
  292.     number of levels that EI files may be nested.  8 is a good number.
  293. SBFINIT    size of search string buffer
  294. TBFINIT    size of tag buffer for O command, max size of label to search for
  295. ZBFEXP    amount by which the EI file buffer is expanded when there are less
  296.     than ZBFMIN bytes left in the buffer.
  297. ZBFINIT    initial size of the file buffer used to read in a macro executed by
  298.     an "EIfilespec$$" command.
  299. ZBFMIN    minimum size of the EI file buffer before it is expanded.
  300. *****************************************************************************/
  301.  
  302. #if defined(VAX11C)
  303.  
  304. #define EXTERN    globalref    /* to reference an external symbol */
  305. #define GLOBAL    globaldef    /* to define an external symbol */
  306. #define EXTERNV    extern volatile    /* to reference an external volatile symbol */
  307. #define GLOBALV    volatile    /* to define an external volatile symbol */
  308. #define VVOID    void        /* Void function return */
  309.  
  310. #define CBFINIT        20000    /* command buffer initial size */
  311. #define EBFEXP        64000    /* edit buffer expansion value */
  312. #define EBFINIT        64000    /* edit buffer initial size */
  313. #define ERBFSIZ        1024    /* error message buffer */
  314. #define GAPMIN        64000    /* edit buffer gap minimum size */
  315. #define IBFEXP        64000    /* input buffer expansion size */
  316. #define IBFINIT        64000    /* input buffer initial size */
  317. #define IBFMIN        10000    /* input buffer minimum size */
  318. #define NIFDBS        8    /* number of input file data blocks */
  319. #define SBFINIT        1000    /* size of search string buffer */
  320. #define TBFINIT        1000    /* size of tag buffer for O command */
  321. #define WBFINIT        1000    /* batch input and output buffer size */
  322. #define ZBFEXP        64000    /* EI file buffer expansion value */
  323. #define ZBFINIT        64000    /* EI file buffer initial size */
  324. #define ZBFMIN        1000    /* EI file buffer minimum size */
  325.  
  326. #define EXS_SIZE    64    /* size of expression stack */
  327. #define LPS_SIZE    32    /* size of loop stack */
  328. #define MCS_SIZE    32    /* size of macro stack */
  329. #define QRS_SIZE    32    /* size of q-register stack */
  330.  
  331. #elif defined(__TURBOC__) || defined(__POWERC) || defined(unix) || defined(AMIGA)
  332.  
  333. #define EXTERN    extern        /* to reference an external symbol */
  334. #define GLOBAL    /**/        /* to define an external symbol */
  335. #if defined(AMIGA) || defined(unix) && !defined(__GNUC__)
  336. #define EXTERNV    extern        /* to reference an external volatile symbol */
  337. #define GLOBALV    /**/        /* to define an external volatile symbol */
  338. #else
  339. #define EXTERNV    extern volatile    /* to reference an external volatile symbol */
  340. #define GLOBALV    volatile    /* to define an external volatile symbol */
  341. #endif
  342.  
  343. #if defined(__TURBOC__) || defined(__POWERC) || defined(__GNUC__) || defined(AMIGA)
  344. #define VVOID        void    /* Void function return */
  345. #else
  346. #define VVOID        /**/    /* Void function return */
  347. #endif
  348.  
  349. #if TC_SMALL_DATA
  350.  
  351. /*
  352.  * with the DEBUGGING #define off, Turbo C can compile teco-c for the small
  353.  * data model which is sometimes easier to debug.  use "make -DMODEL=s or m".
  354.  *
  355.  * define smaller buffer sizes
  356.  */
  357.  
  358. #define CBFINIT        100    /* command buffer initial size */
  359. #define EBFEXP        1000    /* edit buffer expansion value */
  360. #define EBFINIT        8000    /* edit buffer initial size */
  361. #define ERBFSIZ        100    /* error message buffer */
  362. #define GAPMIN        1000    /* edit buffer gap minimum size */
  363. #define IBFEXP        1000    /* input buffer expansion size */
  364. #define IBFINIT        8000    /* input buffer initial size */
  365. #define IBFMIN        1000    /* input buffer minimum size */
  366. #define NIFDBS        6    /* number of input file data blocks */
  367. #define SBFINIT        100    /* size of search string buffer */
  368. #define TBFINIT        100    /* size of tag buffer for O command */
  369. #define ZBFEXP        1000    /* EI file buffer expansion value */
  370. #define ZBFINIT        8000    /* EI file buffer initial size */
  371. #define ZBFMIN        1000    /* EI file buffer minimum size */
  372.  
  373. /*
  374.  * define far heap management calls used in ZMSDOS.C in terms of
  375.  * near heap functions.
  376.  */
  377.  
  378. #define farfree(p) free(p)
  379. #define farmalloc(ul) malloc((unsigned int)ul)
  380. #define farrealloc(p,ul) realloc((p),((unsigned int)ul))
  381.  
  382. #else
  383.  
  384. #define CBFINIT        20000    /* command buffer initial size */
  385. #define EBFEXP        64000L    /* edit buffer expansion value */
  386. #define EBFINIT        64000L    /* edit buffer initial size */
  387. #define ERBFSIZ        128    /* error message buffer */
  388. #define GAPMIN        64000L    /* edit buffer gap minimum size */
  389. #define IBFEXP        64000L    /* input buffer expansion size */
  390. #define IBFINIT        64000L    /* input buffer initial size */
  391. #define IBFMIN        1000    /* input buffer minimum size */
  392. #define NIFDBS        8    /* number of input file data blocks */
  393. #define SBFINIT        1000    /* size of search string buffer */
  394. #define TBFINIT        1000    /* size of tag buffer for O command */
  395. #define ZBFEXP        8000    /* EI file buffer expansion value */
  396. #define ZBFINIT        16000    /* EI file buffer initial size */
  397. #define ZBFMIN        1000    /* EI file buffer minimum size */
  398.  
  399. #endif
  400.  
  401. #define EXS_SIZE    64    /* size of expression stack */
  402. #define LPS_SIZE    32    /* size of loop stack */
  403. #define MCS_SIZE    32    /* size of macro stack */
  404. #define QRS_SIZE    32    /* size of q-register stack */
  405.  
  406. #elif defined(UNKNOWN)
  407.  
  408. #define EXTERN    extern        /* to reference an external symbol */
  409. #define GLOBAL    /**/        /* to define an external symbol */
  410. #define EXTERNV    extern volatile    /* to reference an external volatile symbol */
  411. #define GLOBALV    volatile    /* to define an external volatile symbol */
  412. #define VVOID    void        /* Void function return */
  413.  
  414. #define CBFINIT        100    /* command buffer initial size */
  415. #define EBFEXP        100    /* edit buffer expansion value */
  416. #define EBFINIT        100    /* edit buffer initial size */
  417. #define ERBFSIZ        100    /* error message buffer */
  418. #define GAPMIN        100    /* edit buffer gap minimum size */
  419. #define IBFEXP        100    /* input buffer expansion size */
  420. #define IBFINIT        100    /* input buffer initial size */
  421. #define IBFMIN        100    /* input buffer minimum size */
  422. #define NIFDBS        4    /* number of input file data blocks */
  423. #define SBFINIT        100    /* size of search string buffer */
  424. #define TBFINIT        100    /* size of tag buffer for O command */
  425. #define ZBFEXP        100    /* EI file buffer expansion value */
  426. #define ZBFINIT        100    /* EI file buffer initial size */
  427. #define ZBFMIN        100    /* EI file buffer minimum size */
  428.  
  429. #define EXS_SIZE    5    /* size of expression stack */
  430. #define LPS_SIZE    5    /* size of loop stack */
  431. #define MCS_SIZE    5    /* size of macro stack */
  432. #define QRS_SIZE    5    /* size of q-register stack */
  433.  
  434. #endif
  435.  
  436. /*****************************************************************************
  437.     Define ZCHKKB, a macro that does a keyboard check under MS-DOS to keep
  438. the Control-Break (Control-C) handler happy.  Under MS-DOS a Control-C isn't
  439. checked for until you make a DOS call to the keyboard, screen, or printer.
  440. To make loops Control-C'able in ExeCSt we make a call to ZCHKKB before
  441. checking GotCtC so that if a Control-C was pressed in a TECO-C loop which
  442. doesn't make an explicit DOS call, ZCHKKB makes a no-op DOS call, which
  443. allows GotCtC to be set correctly.
  444.  
  445.     Should we use Turbo C's setcbrk to make sure BREAK is on ???
  446.  
  447.     Under other operating systems, ZCHKKB() expands to nothing.
  448. *****************************************************************************/
  449.  
  450. #if defined(__TURBOC__)
  451. #include <conio.h>            /* kbhit() prototype */
  452. #define ZCHKKB() ((void)kbhit())    /* check keyboard */
  453. #else
  454. #define ZCHKKB() /**/            /* expand to nothing */
  455. #endif
  456.  
  457. /*****************************************************************************
  458.     Define ZMKOFN, a macro called only by ExeEB.  It's needed because the
  459. semicolon and file version number have to be stripped off of the end of the
  460. fully expanded file name that's in FBf before we can call ZOpOut.
  461. *****************************************************************************/
  462.  
  463. #if defined(VAX11C)
  464. #define ZMKOFN() do { FBfPtr--;} while (*FBfPtr != ';');
  465. #else
  466. #define ZMKOFN() /**/        /* expand to nothing */
  467. #endif
  468.  
  469. /*****************************************************************************
  470.     Define MEMMOVE,  a macro that copies "len" bytes from "source" to
  471. "dest" correctly,  even if "source" and "dest" overlap.  In most cases,  this
  472. maps to the ANSI C function "memmove".  If it doesn't,  there's C code that
  473. does the job in function ZCpyBl,  which is in the Z*.C system-specific code
  474. files.
  475. *****************************************************************************/
  476.  
  477. #if defined(sun)
  478.  
  479. EXTERN VVOID bcopy();
  480. #define MEMMOVE(dest,source,len) bcopy((source),(dest),(len))
  481.  
  482. #elif defined(unix) || defined(AMIGA) || (defined(UNKNOWN) && !defined(__STDC__))
  483.  
  484. EXTERN VVOID ZCpyBl();
  485. #define MEMMOVE(dest,source,len) ZCpyBl((dest),(source),(len))
  486.  
  487. #elif defined(__TURBOC__) || defined(__POWERC)
  488.  
  489. EXTERN VVOID ZCpyBl(charptr dest, charptr source, SIZE_T len);
  490. #define MEMMOVE(dest,source,len) ZCpyBl((dest),(source),(len))
  491.  
  492. #else
  493.  
  494. #define MEMMOVE(dest,source,len) memmove((dest),(source),(len))
  495.  
  496. #endif
  497.  
  498. /*****************************************************************************
  499.     Define EXIT_SUCCESS and EXIT_FAILURE
  500. *****************************************************************************/
  501.  
  502. #ifndef EXIT_SUCCESS
  503. #define EXIT_SUCCESS 0
  504. #endif
  505.  
  506. #ifndef EXIT_FAILURE
  507. #define EXIT_FAILURE 1
  508. #endif
  509.  
  510. /*****************************************************************************
  511.     Define FILENAME_MAX, which is used in Init() and in the Z*.C files.
  512. This is the maximum size of a filename.  It's supposed to be defined in
  513. stdio.h by ANSI C compilers,  but some compilers don't.
  514.  
  515.     In VAX C v3.0, STDIO.H defines FILENAME_MAX as 39,  which is the
  516. length of only the name part of a full file specification.  I'm not sure what
  517. use this is to anybody,  because most VAX file names include a file type,  if
  518. not a version number, directory specification or node specification.  So if
  519. we're on a VAX,  we override stdio's definition with the right one here.
  520. *****************************************************************************/
  521.  
  522. #if defined(unix)
  523.  
  524. #ifndef FILENAME_MAX
  525. #define FILENAME_MAX 64
  526. #endif
  527.  
  528. #elif defined(VAX11C)
  529.  
  530. #undef FILENAME_MAX            /* undefine stdio.h's definition */
  531. #include nam
  532. #define FILENAME_MAX NAM$C_MAXRSS    /* and define the correct one */
  533.  
  534. #elif defined(__TURBOC__) || defined(__POWERC)
  535.  
  536. #define FILENAME_MAX 80            /* MAXPATH */
  537.  
  538. #elif defined(AMIGA)
  539. /*
  540.  * This is filesystem dependent on the Amiga, and there is no real good
  541.  * way to get at it. This value is true for FileSystem and FastFileSystem,
  542.  * but probably isn't for other things (like mounted MS-DOS partitions...)
  543.  */
  544. #define FILENAME_MAX 255
  545.  
  546. #elif defined(UNKNOWN)
  547.  
  548. #define FILENAME_MAX 20
  549.  
  550. #endif
  551.  
  552. /*****************************************************************************
  553.     When compiling with Turbo C set to use smaller and faster Pascal
  554. function calling sequences (tcc -p), main() in TECOC.C and CntrlC() in
  555. ZMSDOS.C have to be specifically declared as C functions.  The _Cdecl
  556. #define in STDDEF.H takes care of this for Turbo.  Define it as nothing
  557. for everyone else.
  558. *****************************************************************************/
  559.  
  560. #if !defined(_Cdecl)
  561. #define _Cdecl /**/
  562. #endif
  563.  
  564.  
  565. /*****************************************************************************
  566.     Bit masks for EZ mode control flag.  These are system-dependent.
  567. *****************************************************************************/
  568.  
  569. #if defined(unix)
  570. #define EZ_NO_VER      1    /* do not do VMS style versions */
  571. #define EZ_ARROW      8    /* */
  572. #define EZ_AUDIO_BEEP      16    /* (CURSES only) on = beep , off = flash */
  573. #define EZ_WIN_LINE      32    /* (CURSES only) line between windows */
  574. #define EZ_FF          128    /* do not stop read on FF */
  575. #define EZ_UNIXNL      256    /* use Unix-style newline terminators */
  576. #define EZ_VT100GRAPHICS  512
  577. #define EZ_BTEE          2048    /* use BTEE instead of DIAMOND */
  578. #define EZ_INVCR      8192    /* don't show CR in scope - closer to */
  579.                 /* TECO-11, but really not as good in */
  580.                 /* my opinion (Mark Henderson) */
  581. #elif defined(AMIGA)
  582. #define EZ_FF        128    /* do not stop read on FF */
  583. #define EZ_UNIXNL    256    /* use Unix-style newline terminators */
  584. #endif
  585.